package com.ct.server;

import cn.hutool.core.thread.ThreadUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class AsyncServer {
    @Async("asyncServiceExecutor1")
    public void as1() {
        ThreadUtil.sleep(5000);
        System.out.println("111111");
        System.out.println(1/0);
        log.info("1111");
    }


    @Async("simpleExecutor")
    public void as2() {
        ThreadUtil.sleep(5000);
        System.out.println("222");
        log.info("222");
    }
}
